<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ElectricValveControlLog extends Model
{
    public $timestamps = false;
    protected $connection = 'mysql_center';
    protected $table = 'electric_valve_control_log';

    //关联客户信息
    public function electric_platform_owner()
    {
        return $this->hasOne(ElectricPlatformOwner::class, 'id', 'user_id');
    }

    //关联区域
    public function community()
    {
        return $this->hasOneThrough(ElectricCommunity::class, ElectricPlatformOwner::class, 'id', 'id', 'user_id', 'community');
    }
}
